# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.CloudSupport.V2beta.Model.EmailMessage do
  @moduledoc """
  An email associated with a support case.

  ## Attributes

  *   `actor` (*type:* `GoogleApi.CloudSupport.V2beta.Model.Actor.t`, *default:* `nil`) - Output only. The user or Google Support agent that created this email message. This is inferred from the headers on the email message.
  *   `bodyContent` (*type:* `GoogleApi.CloudSupport.V2beta.Model.TextContent.t`, *default:* `nil`) - Output only. The full email message body. A best-effort attempt is made to remove extraneous reply threads.
  *   `ccEmailAddresses` (*type:* `list(String.t)`, *default:* `nil`) - Output only. Email addresses CCed on the email.
  *   `createTime` (*type:* `DateTime.t`, *default:* `nil`) - Output only. Time when this email message object was created.
  *   `name` (*type:* `String.t`, *default:* `nil`) - Identifier. Resource name for the email message.
  *   `recipientEmailAddresses` (*type:* `list(String.t)`, *default:* `nil`) - Output only. Email addresses the email was sent to.
  *   `subject` (*type:* `String.t`, *default:* `nil`) - Output only. Subject of the email.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :actor => GoogleApi.CloudSupport.V2beta.Model.Actor.t() | nil,
          :bodyContent => GoogleApi.CloudSupport.V2beta.Model.TextContent.t() | nil,
          :ccEmailAddresses => list(String.t()) | nil,
          :createTime => DateTime.t() | nil,
          :name => String.t() | nil,
          :recipientEmailAddresses => list(String.t()) | nil,
          :subject => String.t() | nil
        }

  field(:actor, as: GoogleApi.CloudSupport.V2beta.Model.Actor)
  field(:bodyContent, as: GoogleApi.CloudSupport.V2beta.Model.TextContent)
  field(:ccEmailAddresses, type: :list)
  field(:createTime, as: DateTime)
  field(:name)
  field(:recipientEmailAddresses, type: :list)
  field(:subject)
end

defimpl Poison.Decoder, for: GoogleApi.CloudSupport.V2beta.Model.EmailMessage do
  def decode(value, options) do
    GoogleApi.CloudSupport.V2beta.Model.EmailMessage.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.CloudSupport.V2beta.Model.EmailMessage do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
